home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / AmigaOS / Aplus_Dev / AP-Website / links / admin / reset.php < prev    next >
Encoding:
PHP Script  |  2002-10-28  |  3.3 KB  |  143 lines

  1. <?
  2. // *******************************************************************
  3. //  admin/reset.php
  4. // *******************************************************************
  5.  
  6. include("../include/config.php");
  7. include("../include/functions.php");
  8.  
  9. include("../include/common.php");
  10. $language = $gl["Language"];
  11.  
  12. include("../include/lang/$language.php");
  13.  
  14. include("../include/session.php");
  15. session_start();
  16. ?>
  17. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  18. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  19. <html>
  20. <head>
  21. <title></title>
  22. <link rel = "stylesheet" type = "text/css" href = "style.css" />
  23. </head>
  24. <?=$adm_body?>
  25. <table cellspacing="0" cellpadding="5" border="1" align="center" width="100%">
  26. <tr>
  27.     <td colspan="2" class="theader">Reset Database Values</td>
  28. </tr><?
  29.  
  30. if(isset($submit)){
  31.     
  32.     if(isset($reset_in)){
  33.         
  34.         $sql = sql_query("
  35.             alter table
  36.                 $tb_links
  37.             drop
  38.                 HitsIn
  39.         ");
  40.  
  41.         $sql = sql_query("
  42.             alter table
  43.                 $tb_links
  44.             add
  45.                 HitsIn int(7) unsigned default '0' not null
  46.         ");
  47.  
  48.         $html .= "<tr><td class=\"text\">Hits In have been reset.</td></tr>";
  49.     }
  50.  
  51.     if(isset($reset_out)){
  52.  
  53.         $sql = sql_query("
  54.             alter table
  55.                 $tb_links
  56.             drop
  57.                 HitsOut
  58.         ");
  59.  
  60.         $sql = sql_query("
  61.             alter table
  62.                 $tb_links
  63.             add
  64.                 HitsOut int(7) unsigned default '0' not null
  65.         ");
  66.  
  67.         $html .= "<tr><td class=\"text\">Hits Out have been reset.</td></tr>";
  68.     }
  69.  
  70.     if(isset($search_terms)){
  71.         
  72.         $sql = sql_query("
  73.             delete from $tb_terms
  74.         ");
  75.  
  76.         $html .= "<tr><td class=\"text\">Search Terms have been reset.</td></tr>";
  77.     }
  78.  
  79.     if(isset($referrers)){
  80.         
  81.         $sql = sql_query("
  82.             alter table
  83.                 $tb_links
  84.             drop
  85.                 InIP
  86.         ");
  87.  
  88.         $sql = sql_query("
  89.             alter table
  90.                 $tb_links
  91.             drop
  92.                 OutIP
  93.         ");
  94.  
  95.         $sql = sql_query("
  96.             alter table
  97.                 $tb_links
  98.             add
  99.                 InIP varchar(15) not null
  100.         ");
  101.  
  102.         $sql = sql_query("
  103.             alter table
  104.                 $tb_links
  105.             add
  106.                 OutIP varchar(15) not null
  107.         ");
  108.  
  109.         $html .= "<tr><td class=\"text\">All Referrer IPs have been reset.</td></tr>";
  110.     }
  111.  
  112.     if(!isset($reset_in) && !isset($reset_out) && !isset($search_terms) && !isset($referrers)){
  113.         $html .= "<tr><td class=\"text\">Nothing has been reset.</td></tr>";
  114.     }
  115.  
  116.     echo $html;
  117. } else {
  118.     ?><tr><form method="post" action="reset.php?<?=session_name()?>=<?=session_id()?>">
  119.         <td width="99%" class="text">Reset Hit In:<br />This will reset all HitsIn counts to zero for all sites.</td>
  120.         <td width="1%"><input class="small" type="checkbox" name="reset_in"></td>
  121.     </tr>
  122.     <tr>
  123.         <td class="text">Reset Hits Out:<br />This will reset all HitsOut counts to zero for all sites.</td>
  124.         <td><input class="small" type="checkbox" name="reset_out"></td>
  125.     </tr>
  126.     <tr>
  127.         <td class="text">Reset Search Terms:<br />This will delete all recorded search terms.</td>
  128.         <td><input class="small" type="checkbox" name="search_terms"></td>
  129.     </tr>
  130.     <tr>
  131.         <td class="text">Reset Referrer IPs<br />This will reset all incoming and outgoing Referrer IPs.</td>
  132.         <td><input class="small" type="checkbox" name="referrers"></td>
  133.     </tr>
  134.     <tr>
  135.         <td colspan="2" align="center"><input class="button" type="submit" 
  136.         name="submit" value="Reset Values"></td>
  137.     </form></tr><?
  138. }
  139. ?>
  140. </table>
  141. </body>
  142. </html>
  143.